<?php


namespace App\Http\Requests\Api;


use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Config;
use Illuminate\Validation\Rule;

class UserVerifyDTO extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'user_id' => 'required|integer',
            'verify' => [
                'required',
                Rule::in(array_keys(Config::get('constant.verify')))
            ]
        ];
    }

    public function messages()
    {
        return [
            'user_id.required' => '缺少用户信息',
            'user_id.integer' => '用户信息错误',
            'verify.required' => '审核参数错误',
            'verify.in' => '审核参数错误',
        ];
    }
}